import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import '@/styles/index.scss'
import pinia from '@/store/index'
import 'virtual:svg-icons-register'
import SvgIcon from '@/components/svg_icon/index.vue'
import { IsHasButton } from './directive/v-has'
import { debounce } from './directive/debounce'
import 'element-plus/theme-chalk/dark/css-vars.css'

// 全局注册icon
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 按钮的显示自定义指令
IsHasButton(app)
debounce(app)

app.component('SvgIcon', SvgIcon)

app.use(router)

app.use(pinia)

app.mount('#app')
